﻿<%@ Page Language="C#" AutoEventWireup="false" CodeFile="recTariffform.aspx.cs" Inherits="SIPO.Web.Forms.Administration.Catalog.recTariffform" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Tariff Form</title>
    <script src="<%= ResolveUrl("~/scripts/jquery.inputmask.bundle.min.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/scripts/jquery.validate.wrapper.js") %>" type="text/javascript"></script>

    <script type="text/javascript">

        $("#btnSave").button({ icons: { primary: "ui-icon-disk"} });
        $("#btnClose").button({ icons: { primary: "ui-icon-close"} });

        $('#btnClose').click(function () {
            parent.$('#dialog').dialog("close");
        });

    </script>

    <script type="text/javascript">

        $(document).ready(function () {

            $("#txtStartDate").datepicker({ showWeek: true, showButtonPanel: true,
                changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy', //, yearRange: '2010:2030'
                onSelect: function (selected) {
                    $("#txtEndDate").datepicker("option", "minDate", selected)
                }
            });

            $("#txtEndDate").datepicker({ showWeek: true, showButtonPanel: true,
                changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy', //, yearRange: '2010:2030'
                onSelect: function (selected) {
                    $("#txtStartDate").datepicker("option", "maxDate", selected)
                }
            });

            // 1. prepare the validation rules and messages.
            var rules = {
                ddlSector: "required",
                ddlSubSector: "required",
                ddlSubSubSector: "required",
                ddlCorporationAction: " required",
                ddlTransType: "required",
                ddlImpostionBase: "required",
                ddlRegEmisiType: "required",
                txtStartDate: "required"

            };
            var messages = {

                ddlSector: "Sektor harus diisi",
                ddlSubSector: "Sub Sektor harus diisi",
                ddlSubSubSector: "Sub Sub Sektor harus diisi",
                ddlCorporationAction: " Aksi Korporasi harus diisi",
                ddlTransType: "Tipe Transaksi harus diisi",
                ddlRegEmisiType: "Regristrasi Emisi Harus diisi",
                ddlImpostionBase: "Dasar Pengenaan harus diisi",
                txtStartDate: "Tanggal mulai harus diisi"
            };


            // tidak boleh huruf dan karakter khusus
            $("#txtValue").inputmask("Regex", { regex: "[0-9.,]*" });

            // tidak boleh huruf dan karakter khusus
            $("#txtMinValue").inputmask("Regex", { regex: "[0-9.,]*" });

            // tidak boleh huruf dan karakter khusus
            $("#txtMaxValue").inputmask("Regex", { regex: "[0-9.,]*" });

            // tidak boleh huruf dan karakter khusus
            $("#txtKelipatan").inputmask("Regex", { regex: "[0-9.,]*" });

            // tidak boleh huruf dan karakter khusus
            $("#txtPercentage").inputmask("Regex", { regex: "[0-9,]*" });
            $('#txtPercentage').blur(function () {
                var persen = $('#txtPercentage').val();
                if (persen > 100) {
                    alert("prosentase tidak valid !");
                    $('#txtPercentage').val('');
                    $('#txtPercentage').focus();
                }
            });

            // 2. Initiate the validator
            var validator = new jQueryValidatorWrapper("form1", rules, messages);

            // 3. Set the click event to do the validation
            $("#btnSave").click(function () {

                if (!validator.validate())
                    return;
                var persen = $('#txtPercentage').val().replace(',','.');
                var validasipercentage = parseFloat(100);
                if (persen > validasipercentage) {
                    alert("prosentase tidak valid !");
                    $('#txtPercentage').val('');
                    $('#txtPercentage').focus();
                    return;
                }

                var sectorid = $("#ddlSector option:selected").val();
                var subsectorid = $("#ddlSubSector option:selected").val();
                var subsubsectorid = $("#ddlSubSubSector option:selected").val();
                var transtypeid = $("#ddlTransType option:selected").val();
                var percentage = $('#txtPercentage').val();
                var value = $('#txtValue').val();
                var minvalue = $('#txtMinValue').val();
                var maxvalue = $('#txtMaxValue').val();
                var percentage = $('#txtPercentage').val();
                var kelipatan = $('#txtKelipatan').val();
                var impositionbaseid = $("#ddlImpostionBase option:selected").val();
                var startdate = $('#txtStartDate').val();
                var enddate = $('#txtEndDate').val();
                var corporationactionid = $("#ddlCorporationAction option:selected").val();
                var regemisitipe = $("#ddlRegEmisiType option:selected").val();

                var isactive = "0";
                var checkIsActive = document.getElementById("chkIsActive");
                if (checkIsActive.checked) {
                    isactive = "1";
                }
                else {
                    isactive = "0";
                }

                var isformula = "0";
                var checkIsFormula = document.getElementById("chkIsFormula");
                if (checkIsFormula.checked) {
                    isformula = "1";
                }
                else {
                    isformula = "0";
                }

                var id = $('#hfID').val();

                var objrecTariff = new Object();
                objrecTariff.TariffID = id;
                objrecTariff.SectorID = encodeURIComponent(sectorid);
                objrecTariff.SubSectorID = encodeURIComponent(subsectorid);
                objrecTariff.SubSubSectorID = encodeURIComponent(subsubsectorid);
                objrecTariff.TransTypeID = encodeURIComponent(transtypeid);
                objrecTariff.Percentage = encodeURIComponent(percentage);
                objrecTariff.Value = encodeURIComponent(value);
                objrecTariff.MinValue = encodeURIComponent(minvalue);
                objrecTariff.MaxValue = encodeURIComponent(maxvalue);
                objrecTariff.Kelipatan = encodeURIComponent(kelipatan);
                objrecTariff.ImpositionBaseID = encodeURIComponent(impositionbaseid);
                objrecTariff.IsActive = encodeURIComponent(isactive);
                objrecTariff.IsFormula = encodeURIComponent(isformula);
                objrecTariff.StartDate = encodeURIComponent(startdate);
                objrecTariff.EndDate = encodeURIComponent(enddate);
                objrecTariff.CorporateActionTypeID = encodeURIComponent(corporationactionid);
                objrecTariff.RegistrationEmisionTypeID = encodeURIComponent(regemisitipe);

                jsonData = JSON.stringify(objrecTariff);

                var handlerUrl = '<%= ResolveUrl("~/ajaxhandler/administration/catalog/recTariffhandler.ashx") %>';

                if (id == 0)
                    CallAjax(handlerUrl, "?method=insert", jsonData);
                else
                    CallAjax(handlerUrl, "?method=update", jsonData);

                parent.$('#dialog').dialog('close');

                setTimeout("parent.$('#table').trigger('reloadGrid');", 3000);

                return false;
            });


            $('#ddlSector').change(function () {

                var transtypeid = $("#ddlTransType option:selected").val();
                if (transtypeid > 0) {

                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/gettransactiontype.ashx?transtype_id=") %>';
                    $.ajax({
                        type: 'POST',
                        url: handlerUrl + transtypeid,
                        contentType: 'application/json',
                        dataType: 'json',
                        success: function (datas) {
                            $.each(datas, function (i, data) {
                                if (data.TransTypeCode == "4") {

                                    //============== jika tipe transaki aksi korporasi

                                    var sectorId = $("#ddlSector option:selected").val();

                                    $subSectors = $('#ddlSubSector');
                                    $subSubSectors = $('#ddlSubSubSector');
                                    if (sectorId > 0) {
                                        var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getsubsector.ashx?method=aksikorporasi&sector_id=") %>';

                                        $.ajax({
                                            type: 'POST',
                                            url: handlerUrl + sectorId,
                                            contentType: 'application/json',
                                            dataType: 'json',
                                            success: function (datas) {
                                                $subSectors.get(0).options.length = 0;
                                                $subSectors.get(0).options[0] = new Option("-- pilih sub sektor --", "");



                                                $.each(datas, function (i, data) {
                                                    $subSectors.append('<option value="' + data.SubSectorID + '">' + data.SubSectorCode + '-' + data.SubSectorName + '</option>');
                                                });

                                                $subSectors.bind("change", function () {
                                                    GetSubSubSector($(this).val());
                                                });
                                            },
                                            error: function () {
                                                alert('Error load sub sektor aksi korporasi!');
                                            }
                                        });
                                    }
                                    else {
                                        $subSectors.get(0).options.length = 0;
                                        $subSectors.get(0).options[0] = new Option("-- pilih sub sektor --", "");
                                        $subSubSectors.get(0).options.length = 0;
                                        $subSubSectors.get(0).options[0] = new Option("-- pilih sub sub sektor --", "");
                                    }



                                    /////====================

                                }

                                else {
                                    //=================jika tipe transaksi tidak aksi korporasi
                                    var sectorId = $("#ddlSector option:selected").val();
                                    $subSectors = $('#ddlSubSector');
                                    $subSubSectors = $('#ddlSubSubSector');
                                    if (sectorId > 0) {
                                        var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getsubsector.ashx?sector_id=") %>';

                                        $.ajax({
                                            type: 'POST',
                                            url: handlerUrl + sectorId,
                                            contentType: 'application/json',
                                            dataType: 'json',
                                            success: function (datas) {
                                                $subSectors.get(0).options.length = 0;
                                                $subSectors.get(0).options[0] = new Option("-- pilih sub sektor --", "");
                                                $subSubSectors.get(0).options.length = 0;
                                                $subSubSectors.get(0).options[0] = new Option("-- pilih sub sub sektor --", "");
                                                $.each(datas, function (i, data) {
                                                    $subSectors.append('<option value="' + data.SubSectorID + '">' + data.SubSectorCode + '-' + data.SubSectorName + '</option>');
                                                });

                                                $subSectors.bind("change", function () {
                                                    GetSubSubSector($(this).val());
                                                });
                                            },
                                            error: function () {
                                                alert('Error!');
                                            }
                                        });
                                    }
                                    else {
                                        $subSectors.get(0).options.length = 0;
                                        $subSectors.get(0).options[0] = new Option("-- pilih sub sektor --", "");
                                        $subSubSectors.get(0).options.length = 0;
                                        $subSubSectors.get(0).options[0] = new Option("-- pilih sub sub sektor --", "");
                                    }
                                }


                            });

                        },
                        error: function () {

                            alert("Gagal load tipe transaksi");
                        }
                    });
                }


                ///===========

            });


            function GetSubSubSector(subsectorID) {
                $subSubSectors = $('#ddlSubSubSector');
                if (subsectorID > 0) {
                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getsubsubsector.ashx?subsector_id=") %>';
                    $.ajax({
                        type: 'POST',
                        url: handlerUrl + subsectorID,
                        contentType: 'application/json',
                        dataType: 'json',
                        success: function (datas) {
                            $subSubSectors.get(0).options.length = 0;
                            $subSubSectors.get(0).options[0] = new Option("-- pilih sub sub sektor --", "");

                            $.each(datas, function (i, data) {
                                $subSubSectors.append('<option value="' + data.SubSubSectorID + '">' + data.SubSubSectorCode + '-' + data.SubSubSectorName + '</option>');
                            });
                        },
                        error: function () {
                            $subSubSectors.get(0).options.length = 0;
                            alert("Gagal isi sub sub sektor");
                        }
                    });
                }
                else {
                    $subSubSectors.get(0).options.length = 0;
                    $subSubSectors.get(0).options[0] = new Option("-- pilih sub sub sektor --", "");
                }

            }


            //              $('#ddlSubSubSector').change(function () {
            //               var subsubsectorId = $("#ddlSubSubSector option:selected").val();
            //                if (subsubsectorId > 0) {
            //                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getsubsubsector.ashx?method=getbyid&subsubsector_id=") %>';
            //                    $.ajax({
            //                        type: 'POST',
            //                        url: handlerUrl + subsubsectorId,
            //                        contentType: 'application/json',
            //                        dataType: 'json',
            //                        success: function (datas) {
            //                           $.each(datas, function (i, data) {
            //                            if(data.IsEmiten==true){
            ////                              $("#ddlCorporationAction").prop("disabled", false);
            //                            }
            //                            else{
            ////                               $("#ddlCorporationAction").prop("disabled", true);
            //                            }
            //                            });
            //                           
            //                        },
            //                        error: function () {
            //                           
            //                            alert("Gagal getdata sub sub sektor");
            //                        }
            //                    });
            //                }
            //               

            //              });




            $('#ddlSubSector').change(function () {
                var transtipeID = $("#ddlTransType option:selected").val();
                if (transtipeID > 0) {
                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/gettransactiontype.ashx?transtype_id=") %>';
                    $.ajax({
                        type: 'POST',
                        url: handlerUrl + transtipeID,
                        contentType: 'application/json',
                        dataType: 'json',
                        success: function (datas) {

                            $.each(datas, function (i, data) {

                                //jika tipe transaksi perijinan dengan kode 1
                                if (data.TransTypeCode == "1") {

                                    ///get data sektor

                                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getsector.ashx?method=getbyid&sector_id=") %>';
                                    var sectorID = $("#ddlSector option:selected").val();
                                    if (sectorID > 0) {
                                        $.ajax({
                                            type: 'POST',
                                            url: handlerUrl + sectorID,
                                            contentType: 'application/json',
                                            dataType: 'json',
                                            success: function (datasectors) {

                                                $.each(datasectors, function (i, datasector) {

                                                    //jika sektor pasar modal dengan kode 2
                                                    if (datasector.SectorCode == "2") {
                                                        ///$("#ddlRegEmisiType").prop("disabled", false);

                                                        //get sub sector emiten

                                                        var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getsubsector.ashx?method=getbyid&subsector_id=") %>';
                                                        var subsectorID = $("#ddlSubSector option:selected").val();
                                                        if (subsectorID > 0) {
                                                            $.ajax({
                                                                type: 'POST',
                                                                url: handlerUrl + subsectorID,
                                                                contentType: 'application/json',
                                                                dataType: 'json',
                                                                success: function (datasubsectors) {

                                                                    $.each(datasubsectors, function (i, datasubsector) {

                                                                        //jika sub sekto emiten dengan kode 4
                                                                        if (datasubsector.SubSectorCode == "4") {
                                                                            $("#ddlRegEmisiType").prop("disabled", false);

                                                                            $regEmisiTypes = $('#ddlRegEmisiType');
                                                                            var handleUrlRegEmisiType = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getregistrationemisiontypeispubliccompany.ashx?isPublicCompany=0") %>';
                                                                            $.ajax({
                                                                                type: 'POST',
                                                                                url: handlerUrlRegEmisiType,
                                                                                contentType: 'application/json',
                                                                                dataType: 'json',
                                                                                success: function (dataRegEmisiTypes) {
                                                                                    $regEmisiTypes.get(0).options.length = 0;
                                                                                    $regEmisiTypes.get(0).options[0] = new Option("-- pilih jenis reg. emisi --", "");

                                                                                    $.each(dataRegEmisiTypes, function (i, data) {
                                                                                        $regEmisiTypes.append('<option value="' + data.RegistrationEmisionTypeID + '">' + data.RegistrationEmisionTypeID + '-' + data.RegistrationEmisionTypeName + '</option>');
                                                                                    });
                                                                                },
                                                                                error: function () {
                                                                                    alert("error get regEmisiType");
                                                                                }
                                                                            });
                                                                        }
                                                                        else {
                                                                            $("#ddlRegEmisiType").prop("disabled", true);
                                                                        }


                                                                    });
                                                                },
                                                                error: function () {
                                                                    alert("Error get sub sector");
                                                                }
                                                            });
                                                        }


                                                        ///==================end get sub sector

                                                    }

                                                });
                                            },
                                            error: function () {
                                                alert("Error get sector");
                                            }
                                        });
                                    }

                                    //==== end get sector

                                }
                                else {
                                    $("#ddlRegEmisiType").prop("disabled", true);
                                    $("select#ddlRegEmisiType").prop('selectedIndex', 0);
                                }

                            });
                        },
                        error: function () {
                            alert("Error get tipe transaksi");
                        }
                    });
                }
            });


            $('#chkIsFormula').click(function () {

                if ($('#chkIsFormula').is(':checked')) {
                    $("#ddlImpostionBase").prop("disabled", false);
                    $("#txtPercentage").prop("disabled", false);
                    $("#txtMinValue").prop("disabled", false);
                    $("#txtMaxValue").prop("disabled", false);
                    $("#txtValue").prop("disabled", true);
                    $("#txtKelipatan").prop("disabled", true);

                    $("#txtValue").val('0');



                } else {
                    $("#ddlImpostionBase").prop("disabled", true);
                    $("#txtPercentage").prop("disabled", true);
                    $("#txtMinValue").prop("disabled", true);
                    $("#txtMaxValue").prop("disabled", true);
                    $("#txtValue").prop("disabled", false);
                    $("#txtKelipatan").prop("disabled", false);

                    $("#txtPercentage").val('0');
                    $("#txtMinValue").val('0');
                    $("#txtMaxValue").val('0');
                    $("#txtKelipatan").val('0');
                    $("select#ddlImpostionBase").prop('selectedIndex', 0);

                }

            });


            $('#ddlTransType').change(function () {

                var transtypeid = $("#ddlTransType option:selected").val();

                $("select#ddlRegEmisiType").prop('selectedIndex', 0);
                $("select#ddlSector").prop('selectedIndex', 0);
                $("select#ddlSubSector").prop('selectedIndex', 0);
                $("select#ddlSubSubSector").prop('selectedIndex', 0);
                if (transtypeid > 0) {

                    $("#ddlSector").prop("disabled", false);
                    $("#ddlSubSector").prop("disabled", false);
                    $("#ddlSubSubSector").prop("disabled", false);
                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/gettransactiontype.ashx?transtype_id=") %>';
                    $.ajax({
                        type: 'POST',
                        url: handlerUrl + transtypeid,
                        contentType: 'application/json',
                        dataType: 'json',
                        success: function (datas) {
                            $.each(datas, function (i, data) {
                                if (data.TransTypeCode == "4") {

                                    $("#ddlCorporationAction").prop("disabled", false);
                                    $('#ddlRegEmisiType').prop("disabled", true);
                                    ////=================== get sektor aksi korporasi

                                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getsector.ashx?method=aksikorporasi") %>';
                                    $Sectors = $('#ddlSector');
                                    $.ajax({
                                        type: 'POST',
                                        url: handlerUrl,
                                        contentType: 'application/json',
                                        dataType: 'json',
                                        success: function (datas) {
                                            $Sectors.get(0).options.length = 0;
                                            $Sectors.get(0).options[0] = new Option("-- pilih sektor --", "");
                                            $.each(datas, function (i, data) {
                                                $Sectors.append('<option value="' + data.SectorID + '">' + data.SectorCode + '-' + data.SectorName + '</option>');
                                            });


                                        },
                                        error: function () {
                                            alert('Error Load Sektor!');
                                        }
                                    });

                                    ///===============================

                                }
                                else {


                                    $("#ddlCorporationAction").prop("disabled", true);
                                    $("select#ddlCorporationAction").prop('selectedIndex', 0);



                                    ////=================== get sektor tidak aksi korporasi

                                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getsector.ashx") %>';
                                    $Sectors = $('#ddlSector');
                                    $SubSectors = $('#ddlSubSector');
                                    $SubSubSectors = $('#ddlSubSubSector');
                                    $.ajax({
                                        type: 'POST',
                                        url: handlerUrl,
                                        contentType: 'application/json',
                                        dataType: 'json',
                                        success: function (datas) {
                                            $Sectors.get(0).options.length = 0;
                                            $Sectors.get(0).options[0] = new Option("-- pilih sektor --", "");

                                            $SubSectors.get(0).options.length = 0;
                                            $SubSectors.get(0).options[0] = new Option("-- pilih sub sektor --", "");

                                            $SubSubSectors.get(0).options.length = 0;
                                            $SubSubSectors.get(0).options[0] = new Option("-- pilih sub sub sektor --", "");
                                            $.each(datas, function (i, data) {
                                                $Sectors.append('<option value="' + data.SectorID + '">' + data.SectorCode + '-' + data.SectorName + '</option>');
                                            });


                                        },
                                        error: function () {
                                            alert('Error Load Sektor!');
                                        }
                                    });



                                    ///===============================


                                }
                            });

                        },
                        error: function () {

                            alert("Gagal getdata sub sub sektor");
                        }
                    });
                }

            });
        });
    
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <table border="0">
        <tr>
            <td style="width: 50">
                Tipe Transaksi
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlTransType" runat="server" Width="300">
                </asp:DropDownList>
                &nbsp;<span style="color: Red;">*</span>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Tipe Aksi Korporasi
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlCorporationAction" runat="server" Width="300">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Sektor
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlSector" runat="server" Width="300">
                </asp:DropDownList>
                &nbsp;<span style="color: Red;">*</span>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Sub Sektor
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlSubSector" runat="server" Width="300">
                </asp:DropDownList>
                &nbsp;<span style="color: Red;">*</span>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Subsub Sektor
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlSubSubSector" runat="server" Width="300">
                </asp:DropDownList>
                &nbsp;<span style="color: Red;">*</span>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Tipe Reg. Emisi
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlRegEmisiType" runat="server" Width="300">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Formula
            </td>
            <td>
                :
            </td>
            <td>
                <asp:CheckBox ID="chkIsFormula" runat="server" />
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Dasar Pengenaan
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlImpostionBase" runat="server" Width="300">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Prosentase
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtPercentage" Text="0" runat="server" Width="100"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Jumlah
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtValue" Text="0" MaxLength="15" runat="server" Width="100"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Jumlah Minimal
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtMinValue" Text="0" runat="server" Width="100"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Jumlah Maksimal
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtMaxValue" Text="0" runat="server" Width="100"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Kelipatan
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtKelipatan" Text="0" runat="server" Width="100"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Tgl. Mulai
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtStartDate" runat="server" Width="100"></asp:TextBox>
                <span style="color: Red;">&nbsp;*</span>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Tgl. Akhir
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtEndDate" runat="server" Width="100"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Aktif
            </td>
            <td>
                :
            </td>
            <td>
                <asp:CheckBox ID="chkIsActive" runat="server" Enabled="False" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
            </td>
            <td>
                <div style="text-align: right; padding-top: 10px;">
                    <button id="btnSave" type="button">
                        Save</button>
                    <button id="btnClose" type="button">
                        Close</button>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
            </td>
            <td>
                <asp:HiddenField ID="hfID" runat="server" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
